<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建虚拟 DOM 对象 - JSX</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
        //1. 创建虚拟 DOM 对象
        let vDOM = <div>
                <h2 title="恭喜恭喜">恭喜谷爱凌获得自由式滑雪女子组冠军</h2>
                <p>2月8日，谷爱凌摘得冬奥会自由式滑雪大跳台金牌！这是谷爱凌的首个冬奥会奖牌！也是北京冬奥会中国队第三金！</p>
            </div>; // JSX 

        //获取真实 DOM 对象
        // let root = document.querySelector('#root');
        // console.log(vDOM);
        // console.log(root);

        //2. 渲染
        ReactDOM.render(vDOM, document.getElementById('root'));
    </script>
</body>
</html>